﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace TPCN.DAL
{
    public class ContactUsObj
    {
        private string _ContactUsID;

        public string ContactUsID
        {
            get { return _ContactUsID; }
            set { _ContactUsID = value; }
        }
        private string _SenderName;

        public string SenderName
        {
            get { return _SenderName; }
            set { _SenderName = value; }
        }
        private string _SenderEmail;

        public string SenderEmail
        {
            get { return _SenderEmail; }
            set { _SenderEmail = value; }
        }
        private string _Title;

        public string Title
        {
            get { return _Title; }
            set { _Title = value; }
        }
        private string _Content;

        public string Content
        {
            get { return _Content; }
            set { _Content = value; }
        }
        private string _Date;

        public string Date
        {
            get { return _Date; }
            set { _Date = value; }
        }
        private string _Active;

        public string Active
        {
            get { return _Active; }
            set { _Active = value; }
        }

        public ContactUsObj SetValuesFromDataReader(IDataReader reader)
        {
            ContactUsObj obj = new ContactUsObj();
            obj.ContactUsID = (reader["ContactUsID"] is DBNull) ? String.Empty : reader["ContactUsID"].ToString();
            obj.SenderName = (reader["SenderName"] is DBNull) ? String.Empty : reader["SenderName"].ToString();
            obj.SenderEmail = (reader["SenderEmail"] is DBNull) ? String.Empty : reader["SenderEmail"].ToString();
            obj.Title = (reader["Title"] is DBNull) ? String.Empty : reader["Title"].ToString();
            obj.Content = (reader["Content"] is DBNull) ? String.Empty : reader["Content"].ToString();
            obj.Date = (reader["Date"] is DBNull) ? String.Empty : reader["Date"].ToString();
            obj.Active = (reader["Active"] is DBNull) ? String.Empty : reader["Active"].ToString();
            return obj;
        }
    }
}
